<style type="text/css">
    img {
        width: 60px;
    }

    input {
        height: 30px;
        margin: 0 10px;
    }

    .classify_select {
        border: 1px solid #d9d9d9;
        border-radius: 2px;
        height: 34px;
        font-size: 14px;
        color: #555;
        width: auto;
        display: inline-block;
    }

    .btn {
        height: 34px;
        line-height: 34px;
        padding: 0 8px;
        min-width: auto;
    }

    th {
        white-space: nowrap;
    }
</style>
<section id="content">
    <section class="vbox">
        <section class="scrollable padder">
            <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
                <li><a href="{:url('Home/index')}"><i class="fa fa-home"></i> 首页</a></li>
                <li><a href="#">问答列表</a></li>
            </ul>
            <section class="panel panel-default">
                <div class="table-responsive">
                    <table class="table table-striped m-b-none" data-ride="datatables" style="text-align:center!important;">
                        <thead>
                            <tr>
                                <th colspan="9">
                                    <div class="row" style="padding: 1rem 0;">
                                        <form class="col-sm-10" action="{:url('Qa/index')}" method="post" enctype="multipart/form-data" style="margin-top: 5px;margin-bottom: 0;display: flex;">
                                            <input type="text" class="form-control" style="width:20rem;display: block;height: 34px;" data-required="true" name="search[search_value]" value="{$search.search_value?$search.search_value:''}" placeholder="问答名">
                                            <button type="submit" class="btn btn-success btn-s-xs btn">搜索</button>
                                            <a href="{:url('Qa/index')}" class="btn btn-default btn-sm btn">清空条件</a>
                                        </form>
                                        <div class="col-sm-2">
                                            <a href="{:url('Qa/add',array('tab'=>1))}" class="btn btn-s-md btn-info">添加问答</a>
                                            <!-- 下载数据 -->
                                            <a href="{:url('Qa/downloadRecordList')}" class="btn btn-s-md btn-primary" target=“_blank” style="margin-left: 30px;">下载数据</a>
                                        </div>
                                    </div>
                                </th>
                            </tr>
                            <tr>
                                <th width="5%" style="text-align:center!important;">ID</th>
                                <th width="20%" style="text-align:left!important;">问答标题</th>
                                <th width="5%" style="text-align:center!important;">问题数</th>
                                <th style="width: 50px;text-align:center!important;">操作</th>
                            </tr>
                        </thead>
                        <tbody style="font-size:1em;" id="my_chk">
                            {volist name="qaList" id="v"}
                            <tr>
                                <td>{$v.id}</td>
                                <td style="text-align: left">
                                    <?php if (mb_strlen($v['title']) > 25) {
                                        echo mb_substr(strip_tags($v['title']), 0, 25) . '...';
                                    } else {
                                        echo $v['title'];
                                    } ?>
                                </td>
                                <td>{$v.qa_num}</td>
                                <td>
                                    <a href="{:url('Qa/add',array('id'=>$v.id,'page'=>$page,'tab'=>1,'search_value'=>$search.search_value))}" class="btn btn-s-md btn-info" style="margin-bottom: 5px;font-size: 12px">基础信息</a>
                                    <a href="{:url('QaBank/list',array('qa_main_id'=>$v.id))}" class="btn btn-s-md btn-info" style="margin-bottom: 5px;font-size: 12px">题目设置</a>
                                    <a href="{:url('Qa/delete',array('id'=>$v.id,'page'=>$page,'status'=>$v.status,'search_value'=>$search.search_value))}" class="btn btn-s-md btn-{$v.status == 1 ? 'danger' :'info'}" style="margin-bottom: 5px;font-size: 12px">{$v.status?'取消发布':'立即发布'}</a>
                                </td>
                            </tr>
                            {/volist}
                        </tbody>
                    </table>
                </div>
                <table border="0" style="width: 100%; height: 20px">
                    <tbody>
                        <tr>
                            <td style="width: 2px; height: 31px"></td>
                            <td style="width: 500px; height: 31px">
                                <span id="pager" style="font-family:宋体;font-size:12px;">
                                    <table border="0" style="font-family:宋体;font-size:12px;">
                                        <tbody>
                                            <tr>
                                                <td align="right">
                                                    <span>
                                                        共<font color="Red">{$count}</font>条记录&nbsp;&nbsp;当前<font color="Red">{$page}</font>/<font color="Red">{$allpage}
                                                        </font>页
                                                    </span> &nbsp;[
                                                    <a id="pager_First" href="{:url('Qa/index',array('page'=>1,'search_value'=>$search.search_value))}" title="首页">首页</a>] &nbsp;[
                                                    <a id="pager_Prev" href="{:url('Qa/index',array('page'=>$page-1,'search_value'=>$search.search_value))}" title="前页">前页</a>] &nbsp;[
                                                    <a id="pager_Next" title="后页" href="{:url('Qa/index',array('page'=>$page+1,'search_value'=>$search.search_value))}">后页</a>]
                                                    &nbsp;[
                                                    <a id="pager_Last" title="尾页" href="{:url('Qa/index',array('page'=>$allpage,'search_value'=>$search.search_value))}">尾页</a>]
                                                    &nbsp;转到
                                                    <form action="{:url('Qa/index')}" method="post" style="display: inline">
                                                        <input type="text" style="display: none" name="search[search_value]" value="{$search.search_value?$search.search_value:''}">
                                                        <input name="page" type="text" value="{$page}" id="pager_txbPage" style="width:30px;">
                                                        <input type="submit" name="pager$btnGo" value="转到" id="pager_btnGo">
                                                    </form>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </span>
                            </td>
                            <td style="width: 100px; height: 31px"></td>
                        </tr>
                    </tbody>
                </table>
            </section>
        </section>
    </section>
    <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen, open" data-target="#nav,html"></a>
</section>

<!-- datatables -->